<template>
  <ul ref="tabBox" class="quick-tab">
    <li class="f-c-c">
      <a href="#">
        <el-tooltip effect="dark" content="回到顶部" placement="top-start">
          <i class="el-icon-top"></i>
        </el-tooltip>
      </a>
    </li>
    <li class="f-c-c">
      <router-link to="/">
        <el-tooltip effect="dark" content="领福利" placement="top-start">
          <el-badge :is-dot="true">
            <i class="el-icon-present"></i>
          </el-badge>
        </el-tooltip>
      </router-link>
    </li>
    <li class="f-c-c">
      <router-link to="/personalCenter">
        <el-tooltip effect="dark" content="个人中心" placement="top-start">
          <el-badge :value="12" :max="100">
            <i class="el-icon-user"></i>
          </el-badge>
        </el-tooltip>
      </router-link>
    </li>
    <li class="f-c-c">
      <router-link to="/">
        <el-tooltip effect="dark" content="在线帮助" placement="top-start">
          <el-badge :value="12" :max="100">
            <i class="el-icon-help"></i>
          </el-badge>
        </el-tooltip>
      </router-link>
    </li>
    <li class="f-c-c">
      <router-link to="/personalCenter">
        <el-tooltip effect="dark" content="购物车" placement="top-start">
          <el-badge :value="userInfo ? userInfo.shop_car : 0" :max="100">
            <i class="el-icon-shopping-cart-2" id="cart"></i>
          </el-badge>
        </el-tooltip>
      </router-link>
    </li>
  </ul>
</template>
<script>
import {moveEle} from "@/public/js/views.js";
export default {
  name: "Side",
  data() {
    return {};
  },
  computed:{
    userInfo(){
      return this.$store.state.userInfo;
    }
  },
  methods: {},
  mounted() {
    moveEle(this.$refs.tabBox);
  },
};
</script>
<style lang="scss" scoped>
.quick-tab {
  cursor: move;
  position: fixed;
  right: 20px;
  bottom: 50px;
  border-radius: $border-radius-base;
  z-index: 1000;
  opacity: 0.7;
  &:hover{
    opacity: 1;
  }
  li{
    height: 80px;
    width: 80px;
    border: 1px solid $border-color-extra-light;
    background: $background-color-base;
  }
  li:first-child {
    border-radius: 5px 5px 0 0;
  }
  li:last-child {
    border-radius: 0 0 5px 5px;
  }
  a {
    color: $color-text-secondary;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45px;
    width: 45px;
    &:hover {
      color: $theme-color;
      text-decoration: none;
      i {
        height: 45px;
        width: 45px;
        font-size: 45px;
      }
    }
  }
  i {
    display: inline-block;
    height: 40px;
    width: 40px;
    font-size: 40px;
  }
}
</style>